//
//  QNJsbridge.h
//  JSAPIModule
//
//  Created by sumeng on 2018/3/2.
//



#import <Foundation/Foundation.h>
#import <WebKit/WebKit.h>
#import "WebViewJavascriptBridge.h"

#import "QNJsbridge+Navigate.h"
#import "QNJsbridge+Content.h"
#import "QNJsbridge+Storage.h"
#import "QNJsbridge+Data.h"


typedef void (^QN_responseBlock)(id data);

@interface QNJsbridge : NSObject

/** 打印日志开关*/
@property (nonatomic, assign) BOOL logging;

/** webViewc操作对象*/
@property (nonatomic, strong) WKWebView *webView;

/** jsBridge操作对象*/
@property (nonatomic, readonly) WebViewJavascriptBridge *bridge;

/**
 公共注册回调方法
 
 @param handler 注册字段
 @param responseBlock 公共回调
 */
- (void)registerHandler:(NSString *)handler responseBlock:(QN_responseBlock)responseBlock;
/** 发送消息*/

/**
 公共发送消息方法

 @param handler 注册字段
 @param data 交互数据源
 @param responseBlock 公共回调
 */
- (void)callHandler:(NSString *)handler data:(id)data responseBlock:(QN_responseBlock)responseBlock;

@end
